home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / pressgen / an312x.exe / UNINSTAL.C < prev    next >
C/C++ Source or Header  |  1993-10-15  |  2KB  |  62 lines

  1. /*
  2.  ████████████████████████████████████████████████████████████████████████████
  3.  █                                                                          █
  4.  █ uninstal.c                                                               █
  5.  █                                                                          █
  6.  █ Uninstall job server and job queue created by install.exe                █
  7.  █                                                                          █
  8.  ████████████████████████████████████████████████████████████████████████████
  9. */
  10.  
  11. #include <stdio.h>
  12. #include <stdlib.h>
  13. #include <nwcalls.h>
  14. #include <nwerror.h>
  15. #include "..\doit.h"
  16.  
  17. #define NWDOS
  18.  
  19. DWORD           queueID;
  20. NWCCODE         cCode;
  21. NWCONN_HANDLE   connID;
  22.  
  23. void main()
  24. {
  25.     cCode = NWCallsInit(NULL, NULL);
  26.     if (cCode != 0) {
  27.         printf("Unable to initialize NetWare interface\n");
  28.         exit(-1);
  29.     }
  30.  
  31.     /* get the connection ID of the server that we're uninstalling from */
  32.     cCode = NWGetDefaultConnectionID(&connID);
  33.     if (cCode != 0) {
  34.         printf("Unable to get connection ID of default server\n");
  35.         exit(-1);
  36.     }
  37.  
  38.     /* delete the job server object */
  39.     cCode = NWDeleteObject(connID, JOBSERV_NAME, OT_DOIT);
  40.     if (cCode == 0)
  41.         printf("Deleted job server object\n");
  42.     else
  43.         printf("Call to NWDeleteObject failed, cCode = %X\n", cCode);
  44.  
  45.  
  46.     /* get the object ID of the queue */
  47.     cCode = NWGetObjectID(connID, JOBSERV_NAME, OT_DOIT_Q, &queueID);
  48.     if (cCode != 0) {
  49.         printf("Call to NWGetObjectID failed, cCode = %X\n", cCode);
  50.         exit(-1);
  51.     }
  52.  
  53.     /* delete the queue */
  54.     cCode = NWDeleteObject(connID, JOBSERV_NAME, OT_DOIT_Q);
  55.     if (cCode == 0)
  56.         printf("Deleted job server object\n");
  57.     else
  58.         printf("Call to NWDeleteObject failed, cCode = %X\n", cCode);
  59.  
  60.     printf("Job server uninstalled\n");
  61. }
  62.